﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MyFace
{
    class Linguas : Estado
    {
        
        List<string> lines = new List<string>();
     
        Botao Alemao, Frances, Ingles, Portugues;

        public void Initialize()
        {
            //RecAlemao = new Rectangle(260, 420, 282, 97);
            //RecFrances = new Rectangle(260, 320 , 282, 97);
            //RecIngles = new Rectangle(260, 220, 282, 97);
            //RecPortugues = new Rectangle(260, 120, 282, 97);

            Alemao = new Botao(@"Linguas\Alemao", new Rectangle(260, 420, 282, 97),0);
            Frances = new Botao(@"Linguas\Frances", new Rectangle(260, 320 , 282, 97),0);
            Ingles = new Botao(@"Linguas\Ingles", new Rectangle(260, 220, 282, 97),0);
            Portugues = new Botao(@"Linguas\Portugues", new Rectangle(260, 120, 282, 97),0);
        }

        public void LoadContent(ContentManager Content)
        {
            Alemao.Load(Content);
            Frances.Load(Content);
            Ingles.Load(Content);
            Portugues.Load(Content);
        }
        public void Update(GameTime gameTime)
        {
            Alemao.Update(gameTime, "Esquerda");
            Portugues.Update(gameTime, "Esquerda");
            Ingles.Update(gameTime, "Esquerda");
            Frances.Update(gameTime, "Esquerda");


            if (Cursor.mstate.LeftButton == ButtonState.Pressed)
            {
                if (Alemao.MouseOver)
                {
                    lines = TextReader.ChangeLanguage("alemao");
                    Game1.lines = lines;
                    Game1.state.estado = CenasDoJogo.MENU;                
                    Console.WriteLine("Alemao");
                    //MenuDeu = true;
                    //LER TXT ALEMAO
                }
                if (Frances.MouseOver)
                {
                    lines = TextReader.ChangeLanguage("frances");
                    Game1.lines = lines;
                    Game1.state.estado = CenasDoJogo.MENU;
                    Console.WriteLine("Frances");
                    //MenuFran = true;
                    //LER TXT FRANCES
                }
                if (Ingles.MouseOver)
                {
                    lines = TextReader.ChangeLanguage("ingles");
                    Game1.lines = lines;
                    Game1.state.estado = CenasDoJogo.MENU;
                    Console.WriteLine("Ingles");
                    //MenuEng = true;
                    //LER TXT INGLES
                }
                if (Portugues.MouseOver)
                {
                    lines = TextReader.ChangeLanguage("portugues");
                    Game1.lines = lines;
                    Game1.state.estado = CenasDoJogo.MENU;
                    Console.WriteLine("Portugues");
                    //MenuPort = true;
                    //LER TXT PORTUGUES
                }
            }
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            Alemao.Draw(spriteBatch);
            Ingles.Draw(spriteBatch);
            Portugues.Draw(spriteBatch);
            Frances.Draw(spriteBatch);           
        }
    }
}
